//
//  BDRootTabBarController.m
//  HSY
//
//  Created by 陈浩 on 2017/4/11.
//  Copyright © 2017年 金开门. All rights reserved.
//

#import "BDRootTabBarController.h"
#import "BDHomeViewController.h"

@interface BDRootTabBarController ()<UITabBarControllerDelegate>

@end

@implementation BDRootTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:RGBA(81, 94, 149, 1), NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
    
    self.delegate = self;
    
    [self setupViewControllers];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)setupViewControllers{
    BDHomeViewController *homeViewController = [[BDHomeViewController alloc] init]; //首页
    
    UIImage *homeDefaultImage = [UIImage imageNamed:@"bd_home"];
    UIImage *homeSelectedImage = [UIImage imageNamed:@"bd_home_click"];
        
    [self addChildViewController:homeViewController image:homeDefaultImage selectedImage:homeSelectedImage title:@"首页" inNavigationCongroller:YES];
}

-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
    
    return YES;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
